﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InformationExtraction
{
    public enum GenderEnum { Male, Female }

    class Person
    {
        public string FirstName { get; set; }
        public string MiddleName { get; set; }
        public string LastName { get; set; }
        public string FullName
        {
            get
            {
                string str = "";
                if (!string.IsNullOrWhiteSpace(FirstName))
                    str += FirstName;
                if (!string.IsNullOrWhiteSpace(MiddleName))
                    str += " " + MiddleName;
                if (!string.IsNullOrWhiteSpace(LastName))
                    str += " " + LastName;
                return (string.IsNullOrWhiteSpace(str) ? null : str);
            }
        }
        public GenderEnum? Gender { get; set; }
        public bool? isAlive { get; set; }
        public DateTime? Birthday { get; set; }
        public string Country { get; set; }
        public List<string> Occupation { get; set; }
        public string BornIn { get; set; }

        public Person()
        {
            this.Occupation = new List<string>();
        }

        public override string ToString()
        {
            string gender = Gender != null ? Gender.Value.ToString() : "-";
            string alive = isAlive != null ? isAlive.Value.ToString() : "-";
            string birthday = Birthday != null ? Birthday.Value.ToShortDateString() : "-";
            string occupation = string.Join(", ", Occupation);
            return string.Format("{0,-13} | {1,-11} | {2,-11} | {3,-7} | {4,-7} | {5,-14} | {6,-10} | {7,-12} | {8}",
                FirstName, MiddleName, LastName, gender, alive, birthday, Country, occupation, BornIn);
        }
    }
}
